import xlrd

data = xlrd.open_workbook('test.xlsx')
# 获取第一个sheet对象
table = data.sheet_by_index(0)
# print(table)

# 获取第二行第一列的值
# print(table.cell_value(1,0))

# 获取表格行数
nrows = table.nrows
# print(nrows)

val = []
# 获取第1列所有值(列表⽣成式)
# for i in range(nrows):
#     val.append(table.cell_value(i, 0))
# print(val)
val = [table.cell_value(i, 0) for i in range(nrows)]
print(val)



